home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
PAS_0693
/
CAPTURE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-06-30
|
2KB
|
57 lines
{─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
Msg : 318 of 434
From : Sean Palmer 1:104/123.0 08 Jun 93 00:26
To : Frank Livaudais
Subj : TSR Dump
────────────────────────────────────────────────────────────────────────────────
FL>Does anyone have any code that will go tsr and dump the
FL>pixel colors in a 320.256. whatever that mode is into a
FL>text file in the format 200,5,0,0,0,4, etc? just list
FL>every pixel followed by a comma?
The TSR part would be the hard part, the writing the screen to a file
would be easy.
I wrote this little prog just now, not incredibly great but might
actually work and probably will do the job...
Be careful as it doesn't check for DOS reentrancy and you might hang
your computer if you try to capture a screen while DOS is doing
something else...}
program capture; {by Sean Palmer, public domain}
uses dos;
procedure writeScrn2File;
var f:text;x,y:word;
begin
assign(f,'CAPTURE.SCR');
rewrite(f);
for y:=0 to 199 do
for x:=0 to 319 do begin
write(f,mem[$A000:y*320+x],',');
if x mod 20=0 then writeln(f); {new line every 20 pixels}
end;
close(f);
end;
var oldIntVec:procedure;
{you need to put a REAL check for dos activity here}
function dosActive:boolean;begin dosActive:=false; end; {assume no and}
{keep fingers crossed! 8)}
procedure keyHandler; interrupt;begin
if port[$60]=114 then {if print-screen pressed}
if not dosActive then {better NOT press while DOS is doing something}
writeScrn2File;
oldIntVec; {call old handler}
end;
begin
getIntVec(9,@oldIntVec);
setIntVec(9,@newIntVec);
keep(0); {go TSR}
end.